import { createStore } from 'vuex'
import VuexPersistence from 'vuex-persist'

const vuexLocal = new VuexPersistence({
    storage: window.localStorage
})

export default createStore({
    state: {
        token: '',
        Treelist: [],
        index: 0
    },
    mutations: {
        settoken(state, val) {
            state.token = val
        },
        setTreelist(state, val2) {
            state.Treelist = val2
        },
        setindex(state, num) {
            state.index = num
        }
    },
    plugins: [vuexLocal.plugin]




})